#include <Adafruit_PWMServoDriver.h>
#include <iostream>
#include <LinuxTwoWire.h>
#include <unistd.h>


int main()
{

    LinuxI2C linuxWire("/dev/i2c-2");
    Adafruit_PWMServoDriver pwm(PCA9685_I2C_ADDRESS, linuxWire);
    pwm.begin();
    pwm.setPWMFreq(50);

    for (int i = 100; i < 600; i+=100) {
        pwm.setPWM(0, 0, i);
        usleep(1000000);
    }
    for (int i = 500; i > 0; i-=100) {
        pwm.setPWM(0, 0, i);
        usleep(1000000);
    }
    return 0;
}
